/**
 * 
 */
package com.java.test.user.dto;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;

import org.springframework.jdbc.core.RowMapper;

/**
 * @author 行为记录
 *
 */
public class BehaviorInfo implements RowMapper<BehaviorInfo> {

	
	
	// 主键id
	private int id;

	// 游戏账号
	private String gameAccount;

	// ip地址
	private String ipAddress;

	// 操作时间
	private LocalDateTime operTime;

	// 行为内容
	private String behaviorContent;
	
	//1: 注册，2登陆，3存款，4提现，5参与游戏，6，签到，7参与活动，8交易流水
	private int behaviorType;
	
	
	
	// 查詢條件
	private String startTime;
	// 查詢條件
	private String endTime;
	
	
	
	
	

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getGameAccount() {
		return gameAccount;
	}

	public void setGameAccount(String gameAccount) {
		this.gameAccount = gameAccount;
	}

	public String getIpAddress() {
		return ipAddress;
	}

	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}

	public LocalDateTime getOperTime() {
		return operTime;
	}

	public void setOperTime(LocalDateTime operTime) {
		this.operTime = operTime;
	}

	public String getBehaviorContent() {
		return behaviorContent;
	}

	public void setBehaviorContent(String behaviorContent) {
		this.behaviorContent = behaviorContent;
	}
	
	
	

	public int getBehaviorType() {
		return behaviorType;
	}

	public void setBehaviorType(int behaviorType) {
		this.behaviorType = behaviorType;
	}

	@Override
	public BehaviorInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
		BehaviorInfo info = new BehaviorInfo();
		info.setId(rs.getInt("id"));
		info.setBehaviorContent(rs.getString("behavior_content"));
		info.setGameAccount(rs.getString("game_account"));
		info.setIpAddress(rs.getString("ip_address"));
		info.setOperTime(rs.getTimestamp("oper_time").toInstant().atZone(ZoneOffset.ofHours(8)).toLocalDateTime());
		info.setBehaviorType(rs.getInt("behavior_type"));
		return info;
	}

}
